package com.shuyuwl.core.repository;

import com.shuyuwl.core.domain.AbstractBaseDomain;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.NoRepositoryBean;

import java.io.Serializable;
import java.util.List;

/**
 * DaoRepository 基础Repository 接口类
 * @Author ZChao
 * @Date 2019/9/3
 **/
@NoRepositoryBean
public interface DaoRepository<T extends AbstractBaseDomain, ID extends Serializable> extends JpaRepository<T, ID> {

    /**
     * 通过id删除多条数据
     * @param ids
     */
    void deleteByIdIn(List<ID> ids);

    /**
     * 通过Id获取数据
     * @param id
     * @param status
     * @return
     */
    <T,ID> T findByIdAndStatus(ID id,Byte status);
}
